import Login from '../page/login';
import Article from '../page/acticle';
import Layout  from '../page/layout';
// import Board from '../page/Board';
// import About from '../page/About';
import Month from '@/page/Month';
import New from '@/page/New';
import Year from '@/page/Year';

//哈希和history模式 createBrowserRouter
import { createHashRouter } from 'react-router-dom';

const router = createHashRouter([
    {
        path:'/',
        // redirect:'/month',
        element:<Layout/>,
          children:[
            {
                path:'month',
                element:<Month/>
            },
            {
                path:'new',
                element:<New/>
            },
            {
                path:'year',
                element:<Year/>

            },
        ]
        // children:[
        //     //设置为默认路由
        //     {
        //         // path:'board',
        //         index:true,
        //         element:<Board/>
        //     },
        //     {
        //         path:'about',
        //         element:<About/>
        //     },
        // ]
    },
    {
        path:'/login',
        element:<Login/>
    },
    {
        path:'/acticle/:id',
        element:<Article/>
    },
    {
        path:'*',
        element:<div>404</div>

    },
    {
        path:'/month',
        element:<Month/>
    },
    {
        path:'/year',
        element:<Year/>
    },
    {
        path:'/new',
        element:<New/>
    },
]);

export default router;